package cn.initcap.algorithm.data.structures.lfucache;

import lombok.extern.slf4j.Slf4j;

/**
 * @author initcap
 * @date Created in 2020/4/5 19:38.
 */
@Slf4j
public class Test {

    public static void main(String[] args) {
        log.info("LFU缓存3个！");
        LfuCache lfu = new LfuCache(3);
        log.info("直接获取1，应该返回 -1 : {}", lfu.get(1));
        lfu.put(1,1);
        lfu.put(2,2);
        lfu.put(3,3);
        lfu.get(1);
        lfu.put(4,4);
        log.info("直接获取1，应该返回 1 : {}", lfu.get(1));
        log.info("获取2应该不存在 : {}", lfu.get(2));
    }

}
